Fix segfault writing ascii .vtu files with implicit cell type arrays
authorAnton Gladky <gladk@debian.org>
Fri, 28 Aug 2026 08:57:41 +0000 (08:57 +0000)
committerFrancesco Ballarin <ballarin@debian.org>
Fri, 28 Aug 2026 08:57:41 +0000 (08:57 +0000)
commit989d974459f1c1ecab7053caf9d9ab5abb89f6b9
tree987a8305999328915c90239cdcb630fbe78db66d
parent8639c8cb024bd216c54351faf4fb4d67394fd422
Fix segfault writing ascii .vtu files with implicit cell type arrays

Forwarded: not-yet

NewIterator() returns nullptr for the implicit cell-type arrays used
since VTK 9.6, so WriteAsciiData() dereferenced that nullptr in
iter->Delete(). Merely guarding the Delete() is not enough: the
templated writer already returns early on a null iterator, so the array
is then written empty, and since WriteInlineData() discards the return
value the writer reports success for a file which has lost all of its
cells. Write such arrays through an explicit copy instead.
Closes yade FTBFS.

Gbp-Pq: Name fix_xmlwriter_ascii_implicit_cellarray_segfault.patch
IO/XML/vtkXMLWriter.cxx